﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="QL_Role.aspx.cs" Inherits="ChineseSchool.Admin.QL_Role" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .form-horizontal .control-label {
            text-align: left;
        }
    </style>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#<%= btnAddNew.ClientID %>').click(function () {
                var user = $('#<%= txtUser.ClientID %>');
                if (user.val().length <= 0) {
                    alert('Vui lòng nhập tên người dùng');
                    user.focus();
                    return false;
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder_Top" runat="server">
    <div class="row">
        <div class="col-xs-12">
            <div class="box">
                <div class="box-header with-border">
                    <h3 class="box-title">Phân quyền người dùng:</h3>
                </div>
                <div class="box-body">
                    <div class="form-horizontal">
                        <div class="form-group">
                            <asp:Label ID="lblRole" Text="Nhóm người dùng" CssClass="col-sm-2 control-label" runat="server" />
                            <div class="col-sm-10">
                                <asp:DropDownList ID="ddlRoles" OnSelectedIndexChanged="DdlRolesSelectedIndexChanged"
                                    AutoPostBack="true" CssClass="form-control" runat="server">
                                </asp:DropDownList>
                            </div>
                        </div>
                        <div class="form-group">
                            <asp:Label ID="lblUserName" Text="Tên người dùng" CssClass="col-sm-2 control-label" runat="server" />
                            <div class="col-sm-5">
                                <asp:TextBox ID="txtUser" CssClass="form-control" runat="server" />
                            </div>
                            <div class="col-sm-1">
                                <asp:Button ID="btnAddNew" Text="Thêm mới" CssClass="btn btn-default" OnClick="BtnAddNewClick" runat="server" />
                            </div>
                        </div>
                    </div>
                    <asp:GridView ID="grdUserRole" runat="server" AutoGenerateColumns="False"
                        AllowPaging="True" EnableModelValidation="True" CssClass="table table-bordered"
                        AllowSorting="True" PageSize="10" OnRowCommand="GrdUserRoleRowCommand" OnRowDeleting="GrdUserRoleRowDeleting"
                        OnPageIndexChanging="GrdUserRolePageIndexChanging">
                        <PagerStyle CssClass="grdPaging" BackColor="#F6F6F6" ForeColor="Black" HorizontalAlign="Center"
                            VerticalAlign="Middle" />
                        <Columns>
                            <asp:TemplateField ItemStyle-Width="50px" HeaderText="Stt">
                                <ItemTemplate>
                                    <%# Container.DataItemIndex + 1 %>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:BoundField DataField="UserName" HtmlEncode="false" HeaderText="Tên đăng nhập" ReadOnly="true" />
                            <asp:BoundField DataField="Email" HtmlEncode="false" HeaderText="Email" ReadOnly="true" />
                            <asp:BoundField DataField="JoinDate" ItemStyle-Width="150px" HeaderText="Ngày tham gia" DataFormatString="{0:dd/MM/yyyy}"
                                HtmlEncode="false" ReadOnly="true" />
                            <asp:TemplateField ItemStyle-Width="30px" HeaderText="Xóa" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:ImageButton ID="imgDel" runat="server" ImageUrl="Images/del.gif" ToolTip="Xóa danh mục"
                                        CommandArgument='<%# Eval("UserName") %>' CommandName="Delete" OnClientClick=" return confirm('Xóa user này khỏi group?') " />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </div>
                <div class="box-footer clearfix">
                </div>
            </div>
        </div>
    </div>
</asp:Content>
